package com.lsk.division.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result implements Serializable {
    //是否成功
    private boolean success;
    //状态码 500失败 200成功
    private int code;
    private Object data;

    public static Result SUCCESS(Object obj){
        return new Result(true, 200, obj);
    }

    public static Result ERROR(Object obj){
        return new Result(false, 500, obj);
    }

//    public static class SUCCESS extends Result{
//        public SUCCESS(Object obj){
//            Result result = new Result(true, 200, obj);
//        }
//    }
//
//    public static class ERROR extends Result{
//        public ERROR(Object obj){
//            Result result = new Result(false, 500, obj);
//        }
//    }
}
